﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Pages_UProductsList : Mgh.UI.Sql.PageBase
{
    #region properties

    protected Jewelry.BussinessLayer.ProductBLL bn;

    protected string CategoryID
    {
        get { return Request.QueryString["cid"] == null ? string.Empty : Request.QueryString["cid"]; }
    }

    #endregion

    #region events

    override protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!IsPostBack)
        {
            this.includeCss();
        }
    }

    protected void odsCateCreating(object sender, ObjectDataSourceEventArgs e)
    {
        bn = new Jewelry.BussinessLayer.ProductBLL(getCurrentConnect());
        e.ObjectInstance = bn;
    }

    protected void odsCateSelected(object sender, ObjectDataSourceStatusEventArgs e)
    {
        if (e.ReturnValue == null)
        {
            cvalid.IsValid = false;
            cvalid.Text = bn.getMessage();
        }
    }

    protected void odsCateSelecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        e.InputParameters["strCate"] = this.CategoryID;
    }

    #endregion

    #region functions

    protected void includeCss()
    {
        Literal ltCss = new Literal();
        ltCss.Text = "<link href=\"/Stylesheet/jquery.galleryview-3.0-dev.css\" rel=\"Stylesheet\" type=\"text/css\" media='screen'/><br/>";
        Master.Page.Header.Controls.Add(ltCss);
    }

    #endregion
}